/*//////////////////////////////////////////////////////////////////////////////
//
//                  INTEL CORPORATION PROPRIETARY INFORMATION
//     This software is supplied under the terms of a license agreement or
//     nondisclosure agreement with Intel Corporation and may not be copied
//     or disclosed except in accordance with the terms of that agreement.
//          Copyright(c) 2002-2008 Intel Corporation. All Rights Reserved.
//
*/

#include "umc_defs.h"
#if defined (UMC_ENABLE_MP3_AUDIO_ENCODER)

#ifndef __UMC_MP3_ENCODER_H__
#define __UMC_MP3_ENCODER_H__

#include "umc_media_data.h"
#include "umc_audio_codec.h"
#include "audio_codec_params.h"
#include "mp3_status.h"

struct _MP3Enc;

namespace UMC {


/* /////////////////////////////////////////////////////////////////////////////
//  Class:       MP3Encoder
//
//  Notes:       Implementation of MPEG-I layer 3 encoder.
//
*/
  class   MP3Encoder:public AudioCodec {
  public:
    virtual Status  Init(BaseCodecParams * init);
    virtual Status  Close();

    virtual Status  GetFrame(MediaData * in, MediaData * out);

    virtual Status  GetInfo(BaseCodecParams * init);
    virtual Status  GetDuration(Ipp32f *p_duration);

    MP3Encoder(void);
    virtual ~MP3Encoder();

    virtual Status  SetParams(BaseCodecParams * params);
    virtual Status  Reset();

    virtual IppBool CheckBitRate(Ipp32s sample_rate,
                         Ipp32s layer,
                         Ipp32s bitrate,
                         Ipp32s stereo);

  protected:
    struct _MP3Enc  *state;
    Ipp32s  m_stereo;
    Ipp32s  m_freq;
    Ipp32s  m_layer;
    Ipp32s  m_bitrate;
    Ipp32s  m_br_mode;
    Ipp32s  m_stereo_mode;
    Ipp32s  m_ns_mode;
    Ipp32s  m_id;
    Ipp32s  m_frame_size;
    Ipp32s  m_upsample;
    Ipp32s  m_force_mpeg1;
    Ipp32s  m_mc_matrix_procedure;
    Ipp32s  m_mc_lfe_filter_off;
    Ipp64f  m_pts_prev;
    MemID  stateMemId;
    Ipp32s m_initialized;

    Status StatusMP3_2_UMC(MP3Status st);
    Status MemLock();
    Status MemUnlock();
  };

};      // namespace UMC

#endif /* __UMC_MP3_ENCODER_H__ */

#endif //UMC_ENABLE_MP3_AUDIO_ENCODER
